// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: Call a defend mission
// -----------------------------------------------

private ["_object","_units"];

_object = _this select 0;

_units = (getPosATL player) nearEntities ["CAManBase", 1000];
if (({side _x in wcside} count _units) < (ceil ((playersNumber west) * 0.2))) exitWith {hint "There is not enough player around to start mission"};

//A3 TODO: setVehicleInit
_object setVehicleInit "this removeAction 0;";
processInitCommands;

wcmessageW = ["Turn of duty", "starts now"];
["wcmessageW", "client"] call WC_fnc_publicvariable;

wcbegindefend = true;
["wcbegindefend", "server"] call WC_fnc_publicvariable;